{include file="public_iframe:head"}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>平台人气设置</h5>
            <div class="ibox-tools" style="margin-top: -9px;">
                <a href="javascript:history.go(-1);" class="btn btn-primary"><i class="fa fa-arrow-left"></i> 返回</a>
            </div>
        </div>
        <div class="ibox-content">
            <form action="" method="post" enctype="multipart/form-data" id="brandForm" class="form-horizontal">
                <input type="hidden" name="id" value="{$list.id?$list.id:'';}">

                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">设置人气</label>
                    <div class="col-sm-6">
                        <input type="text" name="num" class="form-control" value="{$list.num?$list.num:''}">
                    </div>
                </div>
       
                  <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <!--<button class="btn btn-primary" type="submit">提交</button>-->
                        <!--href="JavaScript:void(0);" onclick="roleSubmit();"-->
                        <a href="JavaScript:void(0);" onclick="Submit();" class="btn btn-primary" id="submit">提交</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!-- End Panel Basic -->
</div>
<script type="text/javascript" src="__STATIC__/laydate/laydate.js"></script>
<script>
    laydate.render({
        elem: '#time' //指定元素
        ,type:'datetime'
    });
    function Submit(){
        var formData = new FormData();
        var id = $('input[name="id"]').val();
        //var url = $('input[name="url"]').val();
        var num = $('input[name="num"]').val();


        formData.append('id',id);
        //formData.append('url',url);
        formData.append('num',num);

   
        $.ajax({
            url:"{:url('Popularity/doedit')}",
            type:'POST',
            data:formData,
            async:false,
            processData:false,
            contentType:false,
            success:function(result) {
                if(result.code == '0'){
                    parent.layer.alert(result.msg);
                }else{
                    parent.layer.msg(result.msg,{
                                icon:1,
                                time:1000,
                            },
                            function (index, item) {
                               window.location.href="{:url('Popularity/popularity_lists')}";
                            });
                }
            }
        });
    }
</script>
</body>

</html>